﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
    <script src="../Scripts/jquery-1.8.2.js"></script>
    <script src="../Scripts/basejs.js"></script>
    <script src="../Scripts/detailjs.js"></script>
    <link href="../bootstrap/css/bootstrap.css" rel="stylesheet" />
</head>
<body >
   <form  action="" id="form1" method="post" >
       
   </form>

    <div id="div-detail" >
        <h3>{{Title}}</h3>
        <div><span>发布时间:<span fm-conver="convertime">{{IniTime}}</span></span></div>
        <p>{{Body}}</p>
    </div>

    <input type="button" id="btnloadbyid" value="loadbyid" />

    <input type="button" id="btnloadbydata" value="loadbydata" />

    <script>
        
        $(document).ready(function () {
            var data = { Id: 1, Title: "这是个标题", Body: "这是一大坨内容~" ,IniTime:"2014-07-14"};
            var app = $("#div-detail").Detail({
                data:data,
                url: "/article/detail",
                source: "Data"//深层数据{Data:{Title:"标题"},Success:true}如果数据为：{Os:{Data:{Title:"标题"},Success:true}} 则：Os.Data; 默认为空，一层{Title:"标题"}
                //idname:"id" 从url中取id
            });
            //app.load("53ad3a596609411fc0000001");//通过id获取数据
            //app.reload();//刷新数据
            //app.refresh();//刷新页面

            //通过id获取
            $("#btnloadbyid").click(function () {
                app.load("53ad3a596609411fc0000001");
            });

            //通过数据对象
            $("#btnloadbydata").click(function () {
                app.load(data);
            });
        });

        function convertime(obj) {
            return obj.substring(0, 10);
        }
    </script>
</body>

</html>
